class NucleoFamiliar < ActiveRecord::Base
  #Asociaciones
  belongs_to :rol
  belongs_to :persona_responsable,:class_name => "Persona", :foreign_key => "persona_responsable_id"
  belongs_to :persona_integrante,:class_name => "Persona", :foreign_key => "persona_integrante_id"

  #Validaciones
  validates_presence_of :persona_responsable_id, :persona_integrante_id, :rol_id
  validates_uniqueness_of :persona_integrante_id, :scope => :persona_responsable_id
end
